package org.whale.springcloud.eureka.user.feign.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.whale.springcloud.eureka.common.entity.JsonResponse;
import org.whale.springcloud.eureka.user.feign.service.UserFeignService;

import java.util.Map;

@RestController
@RequestMapping("/userFeign")
public class UserFeignController {

  private static final Logger logger = LoggerFactory.getLogger(UserFeignController.class);

  @Autowired private UserFeignService userFeignService;

  @RequestMapping("/queryUserInfo")
  public JsonResponse<String> queryUserInfo(Map<String, String> params) {

    logger.info("start feign query user info");
    params.put("userInfo", "query");
    params.put("clientName", "feign");
    return userFeignService.queryUserInfo(params);
  }
}
